﻿using OpenCvSharp;
using Xc.DataAccess.CodeReader.Properties;
using Xc.DataAccess.Core;

namespace Xc.DataAccess.CodeReader.Models.Filters
{
    /// <summary>
    /// 旋转过滤器
    /// </summary>
    [Filter("旋转",FilterType.Algorithm)]
    public class AlgorithmRotate : FilterBase
    {


        /// <summary>
        /// 旋转标志
        /// </summary>
        [InputParameter("旋转标志")]
        public RotateFlags RotateFlags { get; set; }
        internal override ResultData<Mat> UseChannel(Mat mat, FilterBase[] filterInfos, FilterBase preFilterBase)
        {
                 Mat RotateResult  = new Mat();
                Cv2.Rotate(mat, RotateResult, RotateFlags);
            return ResultData<Mat>.Accept(TextResource.rotate_complete,RotateResult);
        }
    }
}
